package com.cloudfun.campusshare.entity;

import com.cloudfun.campusshare.common.constant.KjtServiceType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * Created by Huqin on 2020/8/11
 */
@Data
@Entity
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "kjt_invoke_his")
public class KjtInvokeHisEntity {

    @Id
    @GenericGenerator(name = "id_uuid", strategy = "uuid")
    @GeneratedValue(generator = "id_uuid")
    @Column(unique = true, columnDefinition = ("varchar(40) not null comment '主键uuid'"))
    private String id;

    @Column(columnDefinition = ("varchar(40) not null comment '用户Id'"))
    private String userId;

    @Column(unique = true, columnDefinition = ("varchar(32) not null comment '请求号'"))
    private String requestNo;

    @Column(columnDefinition = ("varchar(64) not null comment '业务接口名'"))
    @Enumerated(EnumType.STRING)
    private KjtServiceType serviceType;

    @Column(columnDefinition = ("varchar(32) not null comment '签约后分配的快捷通平台'"))
    private String partnerId;

    @Column(columnDefinition = ("datetime not null comment '请求时间'"))
    private LocalDateTime timestamp;

    @Column(columnDefinition = ("text not null comment '对报文摘要的签名'"))
    private String sign;

    @Column(columnDefinition = ("text not null comment '业务接口请求报文'"))
    private String bizContent;

    @Column(columnDefinition = ("text not null comment '加密后的业务接口请求报文'"))
    private String encryptedBizContent;

    @Column(columnDefinition = ("varchar(16) default null comment '网关返回码'"))
    private String resultCode;

    @Column(columnDefinition = ("varchar(64) default null comment '网关返回码描述'"))
    private String resultMsg;

    @Column(columnDefinition = ("varchar(16) default null comment '业务返回码'"))
    private String resultSubCode;

    @Column(columnDefinition = ("text default null comment '业务返回码描述'"))
    private String resultSubMsg;

    @Column(columnDefinition = ("text default null comment '响应报文签名'"))
    private String resultSign;

    @Column(columnDefinition = ("text default null comment '业务接口响应报文'"))
    private String resultBizContent;
}
